﻿//using Microsoft.Extensions.Logging;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp
{
    public class NLog
    {
        private static readonly ILogger logger = LogManager.GetCurrentClassLogger();
        static void Main5(string[] args)
        {
            

            logger.Debug("程序启动");
            try
            {
                logger.Info("开始执行程序逻辑");
                int result = 10 / 1;
                // 将整数转换为字符串进行日志记录
                logger.Info($"计算结果: {result}");
            }
            catch (Exception ex)
            {
                logger.Error(ex, "程序发生异常");
            }
            logger.Warn("程序即将结束");
            logger.Info("程序正常退出");

        }
    }
}
